<?php

	include_once 'classes/CampaignList.php';
	include_once 'classes/Campaign.php';
	include_once 'classes/Product.php';
	session_start();

	$CampaignList = new CampaignList();
	
	$currentCampaignList = $CampaignList->listCampaigns("current");
	
	foreach ($currentCampaignList as $campaigns){
		$camp = new Campaign();
		$camp = $campaigns; 
		echo $camp->brand_id;		
		echo "<br/>";
		echo $camp->name;		
		echo "<br/>";
		echo $camp->date_start;		
		echo "<br/>";
		echo $camp->date_finish;		
		echo "<br/>";
		echo $camp->getImage("logo") ."/" .$camp->getImage("image_front") ."/". $camp->getImage("image_detail");
		echo "<br/>";
		
		$productlist = array();
		$productlist = $camp->getProducts("0");
		foreach ($productlist as $prd) {
			$pr = new Product();
			$pr = $prd;
			echo $pr->name . " , ";
		}
		$categoryList = $camp->getCategories();
		echo "<br />";
		foreach ($categoryList as $ctgry) {
			echo $ctgry . " | ";
		}
		echo "<br/>----------<br/>";
	}
	
	
	
	
	$nextCampaignList = $CampaignList->listCampaigns("current");
	
	foreach ($nextCampaignList as $campaigns){
		
		echo $campaigns->name;
	}
?>